package com.zq.contoller;

import com.zq.log.service.LogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private LogService logService;
    private static Logger LOGGER = LoggerFactory.getLogger(TestController.class);

    @RequestMapping("log")
    public String log(){
        LOGGER.info("{}:{}","controller","log");
        logService.addLog(1,2,"3","4");
        return "OK";
    }

//    @RequestMapping("/login")
//    public String login() {
//        cacheProvider.set("111","222","3333");
//        try {
//            Thread.sleep(5000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        cacheProvider.remove("111","222");
//        return "{\"aa\":\"BBB\"}";
//    }
//
//    @RequestMapping("set/{region}/{key}/{value}")
//    public String set(@PathVariable String region, @PathVariable String key, @PathVariable String value){
//        cacheProvider.set(region,key,value);
//        return "OK";
//    }
//    @RequestMapping("get/{region}/{key}")
//    public String get(@PathVariable String region, @PathVariable String key){
//        String value =cacheProvider.get(region,key);
//        return value;
//    }
}
